<div ng-controller="VMSnapshotCtrl">
    <div class="row-fluid">
        <div class="span9">
            <div class="btn-toolbar server-btn-toolbar ui-toolbar">

                <button type="button" class="btn btn-mini" ng-click="do_add()">新建</button>
                <button type="button" class="btn btn-mini" ng-click="do_recover()" ng-disabled="!snap">恢复</button>
                <button type="button" class="btn btn-danger btn-mini" ng-click="do_delete()" ng-disabled="!snap">删除</button>
            </div>
        </div>
        <div class="span3">
            <span>每页显示</span>
            <select class="input-mini" ng-model="page_size" ng-options="pz for pz in page_sizes"
                    ng-change="change(page_size)">
            </select>
            <span>条</span>
        </div>
    </div>

    <div>
        <table class="table table-striped table-bordered table-condensed">
            <thead>
            <tr>
                <th>名称</th>
                <th>描述</th>
                <th>生成时间</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="snapshot in snapshots | activeitem" ng-click="select()" selectable>
              <td>{{snapshot.name}}</td>
              <td>{{snapshot.description}}</td>
              <td>{{snapshot.created_at|date:'yyyy-MM-dd HH:mm:ss Z'}}</td>
            </tr>
            </tbody>
        </table>

    <div class="pagination">
        <ul>
            <li ng-hide="should_hide()" ng-class="prev_class" ng-click="prev()"><a href="javascript:void(0);">上一页</a>
            </li>
            <li ng-repeat="i in [] | range:page_count()" ng-hide="should_hide()" ng-click="page(i)"
                ng-class="(i == current_page) && 'active'">
                <a href="javascript:void(0)">{{ i + 1}}</a>
            </li>
            <li ng-hide="should_hide()" ng-class="next_class" ng-click="next()"><a href="javascript:void(0);">下一页</a>
            </li>
        </ul>
    </div>
    </div>
</div>